<?php
    //连接数据库
    $db_username = "root";
    $db_password = "root";
    $db_host = "localhost:3306";

    $con = mysql_connect($db_host,$db_username,$db_password);

    if(!$con){
        //如果连接不上就报错
        $json_arr = array( "statu" => "error" , "stateCode" => "2" , "errorType" => "mySQL error".mysql_error());
        echo  json_encode($json_arr);
    }
    mysql_select_db("bilibilidb",$con);
?>